$("#back").on("click",function(){
    window.location.href = "toDataDicetionary";
});
$("#editDataDictionaryBtn").click(function () {
    var id = $("#dataDictionaryId").val();
    var typeCode = $("#typeCode").val();
    var typeName = $("#typeName").val();
    var valueId = $("#valueId").val();
    var valueName = $("#valueName").val();
    if (typeCode==null || typeCode==''){
        alert("类型编码不能为空")
    }
    if (typeName==null || typeName==''){
        alert("类型名称不能为空")
    }
    if (valueId==null || valueId==''){
        alert("类型值ID不能为空")
    }
    if (valueName==null || valueName==''){
        alert("类型值Name不能为空")
    }
    $.ajax({
        url:'editDataDictionary',
        data:{
            id:id,
            typeCode:typeCode,
            typeName:typeName,
            valueId:valueId,
            valueName:valueName
        },
        type:'post',
        dataType:'json',
        success:function (data) {
            if(data.code=="1"){
                alert("修改成功!")
                window.location.href="toDataDicetionary";
            }else {
                alert(data.message);
                return;
            }
        }
    })
})